package com.yn.service.zy.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yn.common.model.zy.DeviceRentOrderDetailDO;
import com.yn.service.dao.zy.DeviceRentOrderDetailMapper;
import com.yn.service.zy.DeviceRentOrderDetailService;
import com.yn.service.zy.model.dto.DeviceRentOrderDetailDTO;
import org.springframework.stereotype.Service;

/**
 * @ClassName: DeviceRentOrderDetailServiceImpl
 * @Description: 设备订单详情ServiceImpl
 * @Author: ym
 * @Date: 2025/5/10 9:17
 **/
@Service
public class DeviceRentOrderDetailServiceImpl extends ServiceImpl<DeviceRentOrderDetailMapper, DeviceRentOrderDetailDO> implements DeviceRentOrderDetailService {


    @Override
    public DeviceRentOrderDetailDTO getOrderDetail(Integer orderId) {
        LambdaQueryWrapper<DeviceRentOrderDetailDO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(DeviceRentOrderDetailDO::getDeviceRentOrderId, orderId);
        DeviceRentOrderDetailDO deviceRentOrderDetailDO = getOne(queryWrapper);

        return DeviceRentOrderDetailDTO.transform(deviceRentOrderDetailDO);
    }
}
